javax.realtime.DSS
Class EventList

java.lang.Object
  extended byjavax.realtime.DSS.EventList

public class EventList
extends java.lang.Object

Class for scheduled event list.

Note that although threads have priorities, events do not, because there is no sense of priority among external events. Rather, event handlers (threads) have priority, mainly exerted through contention for Resource's, e.g., CPUs.

Author:
gary

Constructor Summary
EventList()
          Void constructor.
 
Method Summary
 EventNotice dequeue()
          Dequeue the next event notice, in time then FIFO order.
 EventNotice dequeue(java.lang.String choiceMode)
          Dequeue the next EventNotice, with randomization of selection if there is more than one EventNotice at the next scheduled time.
 void enqueue(EventNotice eventNotice)
          Enqueue the given EventNotice.
 EventNotice get(int i)
          Return the i-th EventNotice on this EventList.
 boolean isEmpty()
          Test whether this EventList is empty.
 boolean remove(EventNotice eventNotice)
          Remove the given EventNotice
 boolean scheduled(RealtimeThread thread)
          Tests whether the given RealTimeThread is currently scheduled, i.e., has an EventNotice on this EventList.
 int size()
          Return the number of EventNotice's on this EventList.
 EventNotice threadNextEvent(RealtimeThread thread)
          Remove the first EventNotice on this EventList referring to the given RealTimeThread.
 java.lang.String toString()
          Returns a string representation of this EventList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventList

public EventList()
Void constructor.

Method Detail

enqueue

public void enqueue(EventNotice eventNotice)
Enqueue the given EventNotice.

Parameters:
eventNotice - the EventNotice to enqueue.

dequeue

public EventNotice dequeue()
Dequeue the next event notice, in time then FIFO order.

Returns:
the event notice deqeueued.

dequeue

public EventNotice dequeue(java.lang.String choiceMode)
Dequeue the next EventNotice, with randomization of selection if there is more than one EventNotice at the next scheduled time.

Parameters:
choiceMode - If equal to:
  • nondeterministic Try all orderings of events scheduled at the same time and for draws from finite random distributions (valid only if running under JPF)
  • pseudorandom pseudo-randomly select an order among events scheduled at the same time, and for draws from finite random distributions
  • deterministic use FIFO selection among equal time events; no random draws are permitted
Returns:
the dequeued event notice

remove

public boolean remove(EventNotice eventNotice)
Remove the given EventNotice

Parameters:
eventNotice - the EventNotice to be removed
Returns:
true if the given EventNotice was removed

isEmpty

public boolean isEmpty()
Test whether this EventList is empty.

Returns:
true if this event list is empty

size

public int size()
Return the number of EventNotice's on this EventList.

Returns:
the number of EventNotice's on EventList.

get

public EventNotice get(int i)
Return the i-th EventNotice on this EventList.

Parameters:
i - the index into this EventList
Returns:
the i-th EventNotice on this EventList.

threadNextEvent

public EventNotice threadNextEvent(RealtimeThread thread)
Remove the first EventNotice on this EventList referring to the given RealTimeThread.

Parameters:
thread - the given RealTimeThread
Returns:
the first EventNotice on the EventList referring to the given thread. Return null if there is no such EventNotice.

scheduled

public boolean scheduled(RealtimeThread thread)
Tests whether the given RealTimeThread is currently scheduled, i.e., has an EventNotice on this EventList.

Parameters:
thread - the given RealTimeThread
Returns:
true if the given RealTimeThread is currently scheduled, i.e., has an EventNotice.

toString

public java.lang.String toString()
Returns a string representation of this EventList

Returns:
a string representation of this EventList